package com.design;

/**
 * 懒汉模式（线程安全）
 */
public class Singleton02 {

    private Singleton02 singleton02;

    private Singleton02(){

    }

    public synchronized Singleton02 getSingleton02(){
        if(singleton02 == null){
            singleton02 = new Singleton02();
        }
        return singleton02;
    }
}
